Skip to content

feat: clickhouse warehouse setup UI#8028

Open
Zaimwa9 wants to merge 10 commits into
mainfrom
feat/clickhouse-byo-warehouse-frontend
Open

feat: clickhouse warehouse setup UI#8028
Zaimwa9 wants to merge 10 commits into
mainfrom
feat/clickhouse-byo-warehouse-frontend

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Frontend for the clickhouse warehouse connection type, gated behind the clickhouse_warehouse flag (off by default). Builds on the backend in #8020 and the stateless test endpoint in #8060.

  • New ClickHouse config form, visually identical to the Snowflake one: host, name, port, database, username, password and a TLS toggle, with defaults matching the backend. The host is locked when editing; leaving the password blank on edit keeps the stored credentials.
  • Test-before-save flow: Save starts disabled and enables after a connection test against the stateless endpoint (feat: stateless warehouse connection test endpoint #8060). A successful test confirms inline; a failed test still allows saving, with a warning that events won't be delivered until the connection succeeds. Changing any connection field resets the test; name-only edits save without one.
  • No Cancel button on create (the warehouse type cards handle switching); Cancel is kept on edit to return to the connection card.
  • The warehouse setup flow offers ClickHouse alongside Flagsmith and Snowflake when the flag is enabled.
  • The connection card wires the Test connection button for ClickHouse and surfaces the status_detail field: the status tooltip shows the failure reason when the connection is errored, and the test-connection toast reports it instead of a generic message.
  • API layer types updated: write-only credentials, read-only status_detail, new testWarehouseConnectionConfig mutation with a WarehouseConnectionTestResult response type.

How did you test this code?

Unit tests for the form validation, payload and test-flow helpers (npm run test:unit -- --testPathPatterns=clickhouseConfig), npm run lint, npm run typecheck (no new errors against the baseline).

Manually: enable the clickhouse_warehouse flag, go to Environment Settings → Warehouse, test and connect a ClickHouse instance (both reachable and unreachable), save after a failed test to check the warning, then edit it and re-test with changed connection details.

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Jul 22, 2026 1:12pm
flagsmith-frontend-staging Ready Ready Preview, Comment Jul 22, 2026 1:12pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jul 22, 2026 1:12pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds ClickHouse warehouse request and response types, form validation, payload construction, and tests. Introduces feature-flagged ClickHouse selection, creation, editing, and connection testing in warehouse settings. Updates warehouse cards to display status details, host information, and conditional test actions. Moves shared save-button label logic into a utility and restricts polling to Flagsmith connections.

Estimated code review effort: 3 (Moderate) | ~25 minutes


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.67%. Comparing base (f7a302b) to head (af485e8).
⚠️ Report is 13 commits behind head on feat/clickhouse-byo-warehouse-backend.

Additional details and impacted files
@@                            Coverage Diff                            @@
##           feat/clickhouse-byo-warehouse-backend    #8028      +/-   ##
=========================================================================
+ Coverage                                  98.65%   98.67%   +0.02%     
=========================================================================
  Files                                       1507     1514       +7     
  Lines                                      59866    60930    +1064     
=========================================================================
+ Hits                                       59060    60124    +1064     
  Misses                                       806      806              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Zaimwa9 Zaimwa9 changed the title feat: ClickHouse warehouse setup UI behind clickhouse_warehouse flag feat: clickHouse warehouse setup UI Jul 20, 2026
@Zaimwa9 Zaimwa9 changed the title feat: clickHouse warehouse setup UI feat: clickhouse warehouse setup UI Jul 20, 2026
@Zaimwa9
Zaimwa9 marked this pull request as ready for review July 20, 2026 09:09
@Zaimwa9
Zaimwa9 requested review from a team as code owners July 20, 2026 09:09
@Zaimwa9
Zaimwa9 requested review from khvn26 and talissoncosta and removed request for a team July 20, 2026 09:09
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-8028 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-8028 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-8028 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-8028 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-8028 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-8028 Finished ✅ Results

@Zaimwa9

Zaimwa9 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@themis-blindfold review

@themis-blindfold

Copy link
Copy Markdown

⚖️ Themis judgement: ✅ Ship it

Adds the ClickHouse warehouse connection type to the frontend, gated behind the clickhouse_warehouse feature flag. The implementation mirrors the existing Snowflake setup flow: a config form with host/port/database/username/password/TLS fields, payload builder that separates credentials from config, and proper create/edit/test-connection wiring. The API types are widened to accommodate ClickHouse's numeric port and boolean TLS flag, and the new status_detail field surfaces error reasons in both the connection card tooltip and the test-connection toast.

The form validation logic and payload builder are extracted into a standalone module with thorough unit tests covering port range validation, required-field checks, edit-mode password handling, and credential separation. The polling guard correctly limits automatic test-connection calls to Flagsmith-type connections while ClickHouse uses manual "Test connection" instead.

🎯 Correctness 5/5
🧪 Test coverage 4/5
📐 Code quality 5/5
🚀 Product impact 3/5
📝 Walkthrough
  • API types (requests.ts, responses.ts) — config widened to string | number | boolean for ClickHouse's port and secure fields; credentials write-only field and status_detail read-only field added to the warehouse connection types.
  • ClickHouse config utilities (clickhouseConfig.ts) — defaults, form state type, port validator, form validator, and payload builder with credential separation, all covered by unit tests.
  • ClickHouseConfigForm — React form component mirroring the Snowflake ConfigForm; reuses the same SCSS; host is locked on edit, blank password preserves stored credentials.
  • WarehouseSetup — ClickHouse card added to the type selector, gated behind clickhouse_warehouse flag; shows "Coming Soon" when the flag is off.
  • WarehouseConnectionCard — status tooltip now appends status_detail for errored connections; subtitle shows ClickHouse host; "Test connection" button is now wirable via onTestConnection prop.
  • WarehouseTab orchestrator (index.tsx) — create/update/test handlers for ClickHouse; edit form rendered for ClickHouse type; polling guard limits auto-test to Flagsmith connections only.
🧪 How to verify
  1. Enable the clickhouse_warehouse flag in your local Flagsmith instance; confirm the ClickHouse card appears in Environment Settings > Warehouse alongside Flagsmith (Snowflake/BigQuery/Databricks remain "Coming Soon").
  2. Fill the ClickHouse form with valid details and submit; verify the connection is created and the card shows the host in the subtitle.
  3. Click "Test connection" on the card — confirm a success toast for reachable instances and a status_detail-bearing error toast for unreachable ones.
  4. Edit the connection: confirm host is locked, leaving password blank preserves the stored credential, and saving updates the connection.
  5. Run npm run test:unit -- --testPathPatterns=clickhouseConfig — all validation and payload tests should pass.

Automate: the unit tests already cover the form logic; a Cypress/E2E test for the full create-edit-test-delete flow would close the gap.

Product take: Solid feature addition that puts ClickHouse on equal footing with the Flagsmith warehouse type for BYO-warehouse users. Properly gated behind a flag so it ships dark — low-risk incremental rollout.

🧭 Assumptions & unverified claims
  • The default port 9440 matches the backend's default for ClickHouse native TLS; I could not verify the backend serialiser defaults since they are on the base branch, not in this diff.
  • The test-warehouse-connection endpoint returns status_detail in its response body — the frontend type says so and the code uses it, but the backend endpoint was not part of this diff.

A warehouse that connects on the first try — now that's a feature worth flagging. · reviewed at af485e8

@Zaimwa9
Zaimwa9 force-pushed the feat/clickhouse-byo-warehouse-frontend branch from af485e8 to 19b31a1 Compare July 20, 2026 09:16
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41 seconds
commit  af485e8
info  🔄 Run: #18490 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  46.7 seconds
commit  af485e8
info  🔄 Run: #18490 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  4 passed

Details

stats  4 tests across 4 suites
duration  55.8 seconds
commit  af485e8
info  🔄 Run: #18490 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  11.9 seconds
commit  af485e8
info  🔄 Run: #18490 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  40 seconds
commit  19b31a1
info  🔄 Run: #18491 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  35.8 seconds
commit  19b31a1
info  🔄 Run: #18491 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  5 passed

Details

stats  5 tests across 5 suites
duration  32.4 seconds
commit  19b31a1
info  🔄 Run: #18491 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  6.2 seconds
commit  19b31a1
info  🔄 Run: #18491 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  32.4 seconds
commit  7b7a695
info  🔄 Run: #18494 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  47 seconds
commit  7b7a695
info  🔄 Run: #18494 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  36.3 seconds
commit  7b7a695
info  🔄 Run: #18494 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  32 seconds
commit  7b7a695
info  🔄 Run: #18494 (attempt 1)

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jul 20, 2026
@Zaimwa9

Zaimwa9 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@themis-blindfold review once again but this time focus on the frontend design patterns to make sure the used components follow the snowflake designs. Let's flag whether some scss or classes are duplicated, or could be better implemented.
Can I know why you scored 3/5 in product impact while this is clearly a product-focused new addition?

Zaimwa9 added 5 commits July 22, 2026 13:29
- Only render Test connection button when the handler is provided
  (backend only supports ClickHouse, not Snowflake)
- Add missing id attributes on ClickHouse form buttons for E2E
- Extract shared getButtonLabel helper from both config forms
- Extract WarehouseConfigValue named type in requests.ts
- Extract WarehouseConfigResponse named type in responses.ts
@Zaimwa9
Zaimwa9 force-pushed the feat/clickhouse-byo-warehouse-frontend branch from aa07e2f to 42149a9 Compare July 22, 2026 11:39
@Zaimwa9

Zaimwa9 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@themis-blindfold review

@Zaimwa9

Zaimwa9 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

Comment on lines +254 to +255
warningMessage={`We couldn't establish a connection${
testDetail ? `: ${testDetail}` : '.'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nit · ⚡ Quick win

Warning message missing period between testDetail and continuation sentence

Observed: when testDetail is e.g. "Authentication failed", the rendered string is "We couldn't establish a connection: Authentication failed You can save anyway..." — no sentence break before "You".

The falsy branch correctly appends '.', but the truthy branch leaves it to the backend value, which may or may not end with punctuation.

Suggested change
warningMessage={`We couldn't establish a connection${
testDetail ? `: ${testDetail}` : '.'
testDetail ? `: ${testDetail}.` : '.'

@themis-blindfold

Copy link
Copy Markdown

⚖️ Themis judgement: 🧹 Ship it, nits inside

Well-scoped feature addition: a ClickHouse warehouse config form behind a feature flag, mirroring the existing Snowflake form with the addition of a test-before-save flow. The credential/config separation is clean, validation logic is extracted and unit-tested, and the feature flag gating is correct. The new testWarehouseConnectionConfig mutation for pre-save testing is distinct from the existing testWarehouseConnection (by-ID) mutation, and each is wired appropriately.

🎯 Correctness 4/5
🧪 Test coverage 4/5
📐 Code quality 4/5
🚀 Product impact 4/5

🧹 Nits

  • ClickHouseConfigForm.tsx:254: Warning message has a punctuation gap when testDetail is present — the detail runs into the next sentence without a period.

⚖️ Acknowledged

  • Inline union on WarehouseConnection.config extracted into WarehouseConfigResponse — thread resolved by @Zaimwa9.
  • Component folder structure for ClickHouseConfigForm — thread resolved by @Zaimwa9.
  • onTestConnection scoped to ClickHouse only — thread resolved by @coderabbitai[bot]; intentional while Snowflake remains disabled, accepted by @Zaimwa9.
  • getButtonLabel duplication — thread resolved by @Zaimwa9 (extracted to warehouseFormUtils.ts).
  • Missing id attributes on form buttons — thread resolved by @Zaimwa9 (added in the current checkout).
📝 Walkthrough
  • API types (requests.ts, responses.ts) — added ClickHouseConfig, WarehouseConfigResponse, WarehouseConnectionTestResult types; widened config values to string | number | boolean; added credentials and status_detail fields.
  • RTK Query service (useWarehouseConnection.ts) — new testWarehouseConnectionConfig mutation for testing unsaved configs against the API.
  • ClickHouse config logic (clickhouseConfig.ts) — pure validation, payload building, and dirty-checking helpers with full unit tests.
  • ClickHouseConfigForm — new form component with inline test-before-save, TLS toggle, and host locking on edit; reuses existing ConfigForm.scss.
  • WarehouseSetup / index / Card — wired ClickHouse create/edit/test flows, gated behind clickhouse_warehouse flag; status tooltip now shows status_detail for errored connections; polling restricted to flagsmith connections.
🧪 How to verify
  1. Enable the clickhouse_warehouse flag, navigate to Environment Settings > Warehouse, and confirm the ClickHouse card appears and can be selected.
  2. Fill in the ClickHouse form with valid credentials, click "Test connection", and verify the success/failure feedback appears correctly before saving.
  3. Edit an existing ClickHouse connection, change a config field, and confirm the test button reappears and test state resets.
  4. Create a ClickHouse connection with intentionally wrong credentials — verify the warning message is readable and saving still works.
  5. With the flag off, confirm the ClickHouse card shows "Coming Soon" and is not selectable.

Automate: npm run test:unit -- --testPathPatterns=clickhouseConfig covers the validation and payload logic.

Product take: Adds ClickHouse as a second warehouse destination, meaningfully expanding the warehouse integration surface. Solid improvement for users running ClickHouse — the test-before-save flow is a better UX than the Snowflake form currently offers.

🧭 Assumptions & unverified claims
  • The backend POST environments/:id/warehouse-connections/test-warehouse-connection/ endpoint (no connection ID) accepts the same body shape (warehouse_type, config, credentials) that the frontend sends. This is part of backend PR feat: ClickHouse bring-your-own-warehouse connections #8020 and was not verified against the backend code.
  • Default port 9440 matches the ClickHouse Cloud native TLS port. Standard ClickHouse native TLS port is 9440; ClickHouse HTTPS port is 8443. The correct default depends on which protocol the backend uses.

A warehouse that tests its own connection before saving — if only all relationships worked that way. · reviewed at 42149a9

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
frontend/web/components/pages/environment-settings/tabs/warehouse-tab/ClickHouseConfigForm.tsx (1)

1-19: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Still not moved into its own component folder; still imports Snowflake's stylesheet.

This new component remains directly under warehouse-tab/ and still imports ./ConfigForm.scss (Snowflake's stylesheet) instead of a co-located one. This was already flagged on an earlier commit and remains unresolved.

As per path instructions, "Each new component must live in its own folder with a barrel index.ts, a ComponentName/ComponentName.tsx file, co-located ComponentName.scss, any subcomponents, and imports should use the component folder path rather than the inner file."

♻️ Proposed structure
ClickHouseConfigForm/
  index.ts                    // export { default } from './ClickHouseConfigForm'
  ClickHouseConfigForm.tsx
  ClickHouseConfigForm.scss   // own styles, or explicitly shared partial

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e7a6ddfa-32ca-4f81-bc2b-a2fd55b70dd1

📥 Commits

Reviewing files that changed from the base of the PR and between aa07e2f and 42149a9.

📒 Files selected for processing (11)
  • frontend/common/services/useWarehouseConnection.ts
  • frontend/common/types/requests.ts
  • frontend/common/types/responses.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/ClickHouseConfigForm.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/ConfigForm.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseConnectionCard.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseSetup.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/__tests__/clickhouseConfig.test.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/clickhouseConfig.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/index.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/warehouseFormUtils.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
frontend/web/components/pages/environment-settings/tabs/warehouse-tab/ClickHouseConfigForm.tsx (1)

19-19: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Component still isn't in its own folder; still imports Snowflake's stylesheet directly.

This mirrors a previous review finding that hasn't been addressed in this revision: the component lives flat under warehouse-tab/ and pulls in ./ConfigForm.scss rather than having a co-located stylesheet.

As per path instructions, "Each new component must live in its own folder with a barrel index.ts, a ComponentName/ComponentName.tsx file, co-located ComponentName.scss, any subcomponents, and imports should use the component folder path rather than the inner file."

♻️ Proposed structure
ClickHouseConfigForm/
  index.ts                    // export { default } from './ClickHouseConfigForm'
  ClickHouseConfigForm.tsx
  ClickHouseConfigForm.scss    // own styles, or explicitly re-export the shared partial

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f1f631be-943c-4c15-acd5-dea8089fd693

📥 Commits

Reviewing files that changed from the base of the PR and between 6bf7a23 and 42149a9.

📒 Files selected for processing (11)
  • frontend/common/services/useWarehouseConnection.ts
  • frontend/common/types/requests.ts
  • frontend/common/types/responses.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/ClickHouseConfigForm.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/ConfigForm.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseConnectionCard.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/WarehouseSetup.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/__tests__/clickhouseConfig.test.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/clickhouseConfig.ts
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/index.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/warehouseFormUtils.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2e4d7c66-6d0d-4cdb-9993-bd0df48ed25f

📥 Commits

Reviewing files that changed from the base of the PR and between 42149a9 and 8f27c08.

📒 Files selected for processing (2)
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/ClickHouseConfigForm.tsx
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/warehouseFormUtils.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: aa770770-55e9-4904-84af-0dc8a3279710

📥 Commits

Reviewing files that changed from the base of the PR and between 8f27c08 and 78816ff.

📒 Files selected for processing (1)
  • frontend/web/components/pages/environment-settings/tabs/warehouse-tab/ClickHouseConfigForm.tsx

Comment on lines +93 to +108
if (result.status === 'connected') {
setTestState('connected')
setTestDetail(null)
toast('Connection verified')
} else {
setTestState('errored')
setTestDetail(result.status_detail)
toast(
result.status_detail || 'Connection failed — check your credentials',
'danger',
)
}
} catch {
setTestState('errored')
setTestDetail(null)
toast('Failed to test connection', 'danger')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Discard test results for superseded form values.

A request can resolve after setField resets the test state for changed connection fields. Its stale success then sets connected, enabling save for an untested configuration. Track a monotonically increasing test revision (incremented on field changes) and ignore success/error results whose revision is no longer current.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant